<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!--#include file="../inc/conn.asp"-->
<!--#include file="../inc/md5.asp"-->
<!--#include file="../inc/google.asp"-->
<!--#include file="../common/admin.asp"-->
<%
set rslistx=server.CreateObject("adodb.recordset")
sql="select top 10 * from y_cat where title is null order by id asc"
rslistx.open sql,conn,1,3
if not rslistx.eof then
do while not rslistx.eof
mark=0
	  if id="" then
		  id=rslistx("id")
		  namefy=rslistx("Short")
	  else
		  namefy=namefy+"<br>"&rslistx("Short")
		  id=id&","&rslistx("id")
	  end if
rslistx.movenext
loop
rslistx.close
set rslistx=nothing
end if	
'翻译                                                
url="http://translate.google.cn/translate_t?langpair=ja|zh&hl=zh&ie=utf-8&text="&server.urlencode(ResumeUBBCode(namefy))&""
wstr=getHTTPPage(url)
start=Newstring(wstr,"TRANSLATED_TEXT='")  
body=Mid(wstr,start+17) 
body=split(body,"';INPUT_TOOL_PATH=")
for i=0 to ubound(body)
keycontent=body(0)
next
if keycontent<>"" then
set rslist=server.CreateObject("adodb.recordset")
sql="select title from y_cat where CHARINDEX(','+LTRIM(id)+',',','+'"& id &"'+',')>0 order by id asc"
rslist.open sql,conn,1,3
if not rslist.eof then
x=0
do while not rslist.eof
rutitle=split(keycontent,"\r\x3cbr\x3e")
for ii=0 to ubound(rutitle)
rslist("title")=rutitle(x)
next
x=x+1
rslist.movenext
loop
rslist.close
set rslist=nothing
end if	
end if
if mark="0" then
set rss=conn.execute("SELECT count(id) FROM y_cat where title is null")
response.Write "<script type=""text/javascript"">setTimeout('window.location=""cat_go.asp"";', 3000);</script>"
response.Write "有"&rss(0)&"环节需要执行，请耐心等待"
response.End()	 
else
response.Write "操作已经完成"
response.End()
end if                       
%>